package com.sany.taskmanager.ui.widget;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.WindowManager;

import androidx.annotation.NonNull;

import com.sany.taskmanager.R;
import com.sany.taskmanager.databinding.DialogLoadingBinding;

/**
 * 弹框：加载中...
 */
public class LoadingDialog extends Dialog {
    public LoadingDialog(@NonNull Context context) {
        super(context, R.style.CustomDialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        DialogLoadingBinding loadingBinding = DialogLoadingBinding.inflate(getLayoutInflater());
        setContentView(loadingBinding.getRoot());
        setCanceledOnTouchOutside(false);
        WindowManager.LayoutParams params = getWindow().getAttributes();
        params.width = 300;
        params.height = 300;
        getWindow().setAttributes(params);
    }
}
